Fix HOME defaulting to CWD inside container (#36)#55
Closed
yarikoptic wants to merge 1 commit intomainfrom
Closed
Conversation
With --userns=keep-id, the host UID has no /etc/passwd entry in the container, so podman defaults HOME to the working directory. This causes several problems: - ~/.claude resolves to $CWD/.claude instead of the mounted config dir - Node.js os.homedir() === process.cwd(), so Claude Code treats every workspace as "running from home directory" - Workspace trust acceptance is only session-scoped (never persisted), causing the "trust this folder?" dialog on every launch Explicitly set HOME=/home/node (the Dockerfile's user home with shell configs) so that HOME is stable regardless of workspace. Claude Code's config is found via CLAUDE_CONFIG_DIR which is already set independently. Co-Authored-By: Claude Code 2.1.81 / Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
See my comment here: #46 (comment) |
Closed
Member
|
(list for expand link hack)
@yarikoptic if that works for you lets close this one. |
Member
Author
|
#61 fixed it properly I think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tested on a few sessions - seems to work nice ! Might have "unsandboxing" effect though since now ~/.claude is user's claude so changes do persist
With --userns=keep-id, the host UID has no /etc/passwd entry in the container, so podman defaults HOME to the working directory. This causes several problems:
Explicitly set HOME=/home/node (the Dockerfile's user home with shell configs) so that HOME is stable regardless of workspace. Claude Code's config is found via CLAUDE_CONFIG_DIR which is already set independently.